package Package.Example_2;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

public class Example_2 {
    public static final void Example_2() throws IOException {
        ServerSocket ss=new ServerSocket(10086);
//        监听客户端的链接
        Socket s=ss.accept();
//        获取输入流
        InputStream inputStream = s.getInputStream();
        BufferedReader br=new BufferedReader(new InputStreamReader(inputStream));
        String len;
        while ((len=br.readLine())!=null){
            System.out.println(len);
        }
        ss.close();
    }
}
